home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Games / MAME / src / mame.h < prev    next >
C/C++ Source or Header  |  2000-05-20  |  3KB  |  111 lines

  1. #ifndef MACHINE_H
  2. #define MACHINE_H
  3.  
  4. #include "osdepend.h"
  5. #include <stdio.h>
  6. #include <string.h>
  7. #include <stdlib.h>
  8.  
  9. #ifdef MESS
  10. #include "mess/mess.h"
  11. #endif
  12.  
  13. extern char build_version[];
  14.  
  15. #define MAX_GFX_ELEMENTS 32
  16. #define MAX_MEMORY_REGIONS 32
  17.  
  18. struct RunningMachine
  19. {
  20.     unsigned char *memory_region[MAX_MEMORY_REGIONS];
  21.     unsigned int memory_region_length[MAX_MEMORY_REGIONS];    /* some drivers might find this useful */
  22.     int memory_region_type[MAX_MEMORY_REGIONS];
  23.     struct GfxElement *gfx[MAX_GFX_ELEMENTS];    /* graphic sets (chars, sprites) */
  24.     struct osd_bitmap *scrbitmap;    /* bitmap to draw into */
  25.     unsigned short *pens;    /* remapped palette pen numbers. When you write */
  26.                             /* directly to a bitmap, never use absolute values, */
  27.                             /* use this array to get the pen number. For example, */
  28.                             /* if you want to use color #6 in the palette, use */
  29.                             /* pens[6] instead of just 6. */
  30.     unsigned short *game_colortable;    /* lookup table used to map gfx pen numbers */
  31.                                         /* to color numbers */
  32.     unsigned short *remapped_colortable;    /* the above, already remapped through */
  33.                                             /* Machine->pens */
  34.     const struct GameDriver *gamedrv;    /* contains the definition of the game machine */
  35.     const struct MachineDriver *drv;    /* same as gamedrv->drv */
  36.     int color_depth;    /* video color depth: 8 or 16 */
  37.     int sample_rate;    /* the digital audio sample rate; 0 if sound is disabled. */
  38.                         /* This is set to a default value, or a value specified by */
  39.                         /* the user; osd_init() is allowed to change it to the actual */
  40.                         /* sample rate supported by the audio card. */
  41.     int obsolete;    // was sample_bits;    /* 8 or 16 */
  42.     struct GameSamples *samples;    /* samples loaded from disk */
  43.     struct InputPort *input_ports;    /* the input ports definition from the driver */
  44.                                 /* is copied here and modified (load settings from disk, */
  45.                                 /* remove cheat commands, and so on) */
  46.     struct InputPort *input_ports_default; /* original input_ports without modifications */
  47.     int orientation;    /* see #defines in driver.h */
  48.     struct GfxElement *uifont;    /* font used by DisplayText() */
  49.     int uifontwidth,uifontheight;
  50.     int uixmin,uiymin;
  51.     int uiwidth,uiheight;
  52.     int ui_orientation;
  53. };
  54.  
  55. #ifdef MESS
  56. #define MAX_IMAGES    32
  57. /*
  58.  * This is a filename and it's associated peripheral type
  59.  * The types are defined in mess.h (IO_...)
  60.  */
  61. struct ImageFile {
  62.     const char *name;
  63.     int type;
  64. };
  65. #endif
  66.  
  67. /* The host platform should fill these fields with the preferences specified in the GUI */
  68. /* or on the commandline. */
  69. struct GameOptions {
  70.     void *record;
  71.     void *playback;
  72.     void *language_file; /* LBO 042400 */
  73.  
  74.     int mame_debug;
  75.     int cheat;
  76.     int gui_host;
  77.  
  78.     int samplerate;
  79.     int use_samples;
  80.     int use_emulated_ym3812;
  81.  
  82.     int color_depth;    /* 8 or 16, any other value means auto */
  83.     int norotate;
  84.     int ror;
  85.     int rol;
  86.     int flipx;
  87.     int flipy;
  88.     int beam;
  89.     int flicker;
  90.     int translucency;
  91.     int antialias;
  92.     int use_artwork;
  93.  
  94.     #ifdef MESS
  95.     struct ImageFile image_files[MAX_IMAGES];
  96.     int image_count;
  97.     #endif
  98. };
  99.  
  100. extern struct GameOptions options;
  101. extern struct RunningMachine *Machine;
  102.  
  103. int run_game (int game);
  104. int updatescreen(void);
  105. void draw_screen(int bitmap_dirty);
  106. void update_video_and_audio(void);
  107. /* osd_fopen() must use this to know if high score files can be used */
  108. int mame_highscore_enabled(void);
  109.  
  110. #endif
  111.